package main

import (
	"com.jtthink/go_rabbitMQ/lib"
	"fmt"
	"github.com/streadway/amqp"
	"time"
)

func SendMail2(msgs <-chan amqp.Delivery, c string) {

	for msg := range msgs {
		{
			fmt.Println("向我开炮", c)
			time.Sleep(time.Second)
		}

		fmt.Println(msg.DeliveryTag, string(msg.Body))
		msg.Ack(false)
	}

}

func main() {

	mq := lib.NewMq()

	mq.Consume(lib.QUEUE_NEW_USER, "c2", "c2", SendMail2)

}
